#ifndef PARTITIONELEMENT_H
#define PARTITIONELEMENT_H

//#include "BigBlock.h"
#include "SmallBlock.h"


enum TypeOfPartition
{
    Value,
    Hypothesis
};


class PartitionElement
{
public:
    //Constructor for "Cell Value"
    PartitionElement(Cell *newCell, short valueNew ) ;
    //Constructor for job with candidates
    PartitionElement(Cell *newCell,short assumptionValue, bool canState ) ;

    //Apply changes
    bool exec() ;
    //Cancel changes
    void revert() ;
    //Reverse object (For method of Branches and Borders)
    void radicallyChange() ;

    friend std::ostream& operator<<( std::ostream& out, const PartitionElement partition ) ;

    //---Getters and Setters---

    Cell* getCell() ;

    void setTransactionID( int newTransactionID ) ;
    int getTransactionID() ;

    short getOldValue() ;
    void setOldValue( short newOldValue ) ;

    short getNewValue() ;




private:
    //----Fields----

    //Number of transaction
    int transactionID ;
    //Pointer to cell for change
    Cell* cell ;

    //Type of Element
    //"Value" - for change cell value
    //"Hypothesis" - del or add cadidate
    TypeOfPartition type ;
    //Valiue for add to candidates or del from candidates
    short assumValue ;
    //Delete or add
    bool digitCanState ;

    //Old value of cell (For can rollback)
    short oldValue ;
    //Value for cell
    short newValue ;
};

#endif // PARTITIONELEMENT_H
